Upload sha256 sums of cargo artifacts
authorAlex Crichton <alex@alexcrichton.com>
Tue, 6 Dec 2016 06:54:11 +0000 (22:54 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 6 Dec 2016 06:54:11 +0000 (22:54 -0800)
.travis.yml
appveyor.yml

index 1b23028dec7c70eb191ad5df2c3a21881dc80ab7..db5a623335e905f0c9bbf832acfaf55aedf87ba9 100644 (file)
@@ -133,6 +133,12 @@ before_deploy:
   - mkdir -p deploy/$TRAVIS_COMMIT
   - cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
     deploy/$TRAVIS_COMMIT
+  - >
+      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+          find "deploy/$TRAVIS_COMMIT" -maxdepth 1 -type f -exec sh -c 'shasum -a 256 -b "{}" > "{}.sha256"' \;;
+      else
+          find "deploy/$TRAVIS_COMMIT" -maxdepth 1 -type f -exec sh -c 'sha256sum -b "{}" > "{}.sha256"' \;;
+      fi
 
 deploy:
   - provider: s3
index ee076135bc718bbef8ee8c85192ba81cbcf2ff4e..488c2dee8ed3f339089cc379ad2116433cad1ea0 100644 (file)
@@ -53,9 +53,10 @@ after_test:
   - ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
   - ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
   - ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}
+  - ps: Get-FileHash .\${env:APPVEYOR_REPO_COMMIT}\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
 
 artifacts:
-  - path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
+  - path: $(APPVEYOR_REPO_COMMIT)\cargo-*
     name: cargo
 
 deploy: